package com.qst.service.impl;

import org.springframework.stereotype.Service;

import com.qst.bean.OrderModel;
import com.qst.service.IOrderService;

import java.math.BigDecimal;

@Service
public class OrderServiceImpl implements IOrderService {
    @Override
    public OrderModel createOrder(Long productId, Long userId) {
        OrderModel orderModel = new OrderModel();
        //模拟的jia数据原本应该是数据库的
        orderModel.setId(1L);
        //总金额：商品的金额*商品购买的数量
        orderModel.setTotalAmount(BigDecimal.ZERO);
        orderModel.setAddress("北京");
        orderModel.setNickName("张三");
        orderModel.setUserId(userId);
        //远程查询商品列表
        orderModel.setProductList(null);//后面应该是远程查询的商品列表
        return orderModel;

    }
}
